import { createRouter, createWebHistory } from "vue-router"; //createWebHistory 不带# createWebHashHistory 带#号
import { management } from "./modules/management";
import { lowCode } from "./modules/lowCode";
import { dashBoard } from "./modules/dashBoard";
import { login } from "./modules/login";
import { agreement } from "./modules/agreement";
import { error } from "./modules/error";
// 定义路由
const routes: any = [
  { path: "/", redirect: "/dashBoard" },
  {
    path: "/page",
    name: "page",
    component: () => import("@/pages/managementPage/index.vue"),
    meta: { title: "", keepAlive: false },
    children: [...management, ...lowCode, ...dashBoard, ...agreement],
  },
  ...login,
  ...error,
];
// 打包变换
const historyName =
  (import.meta as any).env.VITE_NODE_ENV == "development" ? "" : "web";
// 创建路由实例
const router = createRouter({
  history: createWebHistory(historyName),
  routes: routes,
});

export default router;
